#ifndef TIMEDTASKMANAGERAPI_H
#define TIMEDTASKMANAGERAPI_H

#include "Entity/Job.h"
#include <QObject>
#include <QMainWindow>
#include <QtNetwork>
#include <QDebug>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <Utils.h>
#include <config.h>

class TimedTaskManagerApi : public QObject
{
    Q_OBJECT
public:
    explicit TimedTaskManagerApi(QObject *parent = nullptr);
    QByteArray* list(int pageNum,int pageSize,QString jobName,QString jobGroup,QString status);
    QByteArray* editJob(Job &job);
    QByteArray* deleteItems(QString ids);
    QByteArray* getById(qlonglong id);
    QByteArray* changeStatus(QString id,QString status);
    QByteArray* run(QString id,QString group);

    QByteArray* logList(int pageNum,int pageSize,QString jobName,QString jobGroup,QString status,QString start,QString end);
    QByteArray* deleteLogItems(QString ids);
    QByteArray* clean();


private:
    QString baseUrl ;
    QNetworkRequest request;
    QNetworkAccessManager *manager ;
    QByteArray *data = nullptr;
    Utils utils;
};

#endif // TIMEDTASKMANAGERAPI_H
